<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Catalog</title>
</head>
<body>
<body background="../img/bg.jpg"> 
	<font face="Berlin Sans FB Demi" color="#357EC7" size="3">
<center>
<br><br><br><br>
<h1>Statistici elev</h1>
	<?
error_reporting (E_ALL ^ E_NOTICE);
include('auth.php');
include('../config.php');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {die('Failed to connect to server: ' . mysql_error());}
           
$db = mysql_select_db(DB_DATABASE);
if(!$db) {die("Unable to select database");}
$sql=mysql_fetch_array(mysql_query("select * from elev where id='".$_GET['elev']."'"));
?>
<b>


<table border="1">
<tr><td>Nume: </td><td><b><? echo $sql['nume'];?></b></td></tr>
<tr><td>CNP: </td><td><b><? echo $sql['cnp'] ?></b></td></tr>
<tr><td>Clasa: </td><td><b><? echo $sql['clasa'] ?></b></td></tr>
<tr><td>Email: </td><td><b><a href="mailto:<? echo $sql['email'] ?>"><? echo $sql['email'] ?></a></b></td></tr>
<tr><td>Email parinte: </td><td><b><a href="mailto:<? echo $sql['email_parinte'] ?>"><? echo $sql['email_parinte'] ?></a></b></td></tr>
<tr><td>Clasa: </td><td><b><? echo $sql['adresa'] ?></b></td></tr>
<tr><td>Nume parinte: </td><td><b><? echo $sql['nume_parinte'] ?></b></td></tr>
<tr><td>Sex: </td><td><b><? echo $sql['sex'] ?></b></td></tr>
<?
$select=mysql_query("select * from elev_has_materie where elev_id='".$sql['id']."'");
while ($result=mysql_fetch_array($select)) {
$s=explode("-",$result['abs']);
if (strtolower($s[1])=="nemotivata") {
$i++;
} else $j++;
}
?>
<tr><td>Absente nemotivate: </td><td><b><? echo $i ?></b></td></tr>
<tr><td>Absente motivate: </td><td><b><? echo $j ?></b></td></tr>
<tr><td>Medie generala: </td><td><b><? echo $sql['mediegen'] ?></b></td></tr>

</table>


</center>
</body>
</html>